Skip to content

Conversation

@JKneedler
Copy link

No description provided.

it "should loop over the array and return a new array" do
loopy = [1,2,3]
expect(loopy._fill_in_method_here_ { |n| n + 1 }).to eq [2,3,4]
expect(loopy.collect{ |n| n + 1 }).to eq [2,3,4]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! How did you arrive at using collect ? I only ask because a more common method that's in many languages is map

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants